package com.ruoyi.db.mobile.domain;

import lombok.Data;
import lombok.EqualsAndHashCode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import com.ruoyi.framework.web.domain.BaseEntity;
import javax.validation.constraints.Size;
import javax.validation.constraints.NotBlank;
import java.time.LocalDateTime;

/**
 * 文件存储对象 sys_storage
 *
 * @author ruoyi
 * @date 2020-05-05
 */

@ApiModel("文件存储实体类")
@Data
@EqualsAndHashCode(callSuper=true)
public class SysStorage extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("文件编号")
    private Long id;

    @ApiModelProperty("文件的唯一索引")
    @Excel(name = "文件的唯一索引")
    @NotBlank(message = "文件的唯一索引不能为空")
    @Size(min = 0, max = 63, message = "文件的唯一索引长度不能超过63个字符")
    private String fileKey;

    @ApiModelProperty("文件名")
    @Excel(name = "文件名")
    @NotBlank(message = "文件名不能为空")
    @Size(min = 0, max = 255, message = "文件名长度不能超过255个字符")
    private String name;

    @ApiModelProperty("文件类型")
    @Excel(name = "文件类型")
    @NotBlank(message = "文件类型不能为空")
    @Size(min = 0, max = 20, message = "文件类型长度不能超过20个字符")
    private String fileType;

    @ApiModelProperty("文件大小")
    @Excel(name = "文件大小")
    @NotBlank(message = "文件大小不能为空")
    private Integer fileSize;

    @ApiModelProperty("文件访问链接")
    @Excel(name = "文件访问链接")
    @Size(min = 0, max = 255, message = "文件访问链接长度不能超过255个字符")
    private String url;

    @ApiModelProperty("创建时间")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private LocalDateTime addTime;
}
